<?php
namespace app\admin\controller;
use think\Db;
use think\Log;
use think\Controller;
use app\service\wotuService;
use app\service\visitorService;
use app\service\iotmcuService;
class Task extends Controller{
	public function test(){
		Log::write("测试","测试");
	}
	//访客到期时间30分钟
	public function visitordel(){
		//查询访客创建时间大于30分钟的
		$time=time()-6*60*60;
		$userlist=Db::table("gatevisitor")
			->where("create_time","<",$time)
			->order("id desc")
			->select();
		Log::write($userlist,"定时删除访客");
		foreach ($userlist as $key => $userinfo) {

        	
			Db::table("gatevisitor")->where("id",$userinfo["id"])->update(["delete_status"=>"1"]);
		}
	}



}